/*
 * @Date: 2023-01-22 02:17:37
 * @LastEditors: 恶名扬 2080156129@qq.com
 * @LastEditTime: 2023-01-22 05:32:01
 * @FilePath: \campus-repair-platform\server\schema\common\announce.js
 */

/**
 * list_schema  获取公告列表
 * query_schema 根据title模糊查询公告
 */

const joi = require("joi")
const { page, pagesize, a_title: title, id, } = require("../common")

exports.list_schema = {
  query: {
    page,
    pagesize,
    scope: joi.number().min(1).max(4).error(new Error("发布范围格式有误"))
  },
}

exports.query_schema = {
  query: {
    title,
    page,
    pagesize,
    scope: joi.number().min(1).max(4).optional().error(new Error("发布范围格式有误"))
  },
}
